package com.sharemarking.application.common.entity;

import java.sql.Timestamp;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.springframework.format.annotation.DateTimeFormat;

import com.sharemarking.application.common.BaseEntity;

@Entity
@Table(name = "sys_leave")
public class Leave extends BaseEntity{

	private String reason;
	private Timestamp startTime;
	private Timestamp endTime;
	@DateTimeFormat(pattern=("yyyy-mm-dd"))
	private Date checkTime;
	private String state;
	
	//请假者
	@ManyToOne(cascade=CascadeType.PERSIST)
	@JoinColumn(name="employee_id")
	private Employee employee4;
	
	public Employee getEmployee4() {
		return employee4;
	}
	public void setEmployee4(Employee employee4) {
		this.employee4 = employee4;
	}
	
	//审核者
	@ManyToOne(cascade=CascadeType.PERSIST)
	@JoinColumn(name="check_employee_id")
	private Employee employee5;
	
	public Employee getEmployee5() {
		return employee5;
	}
	public void setEmployee5(Employee employee5) {
		this.employee5 = employee5;
	}
	
	
	@ManyToOne(cascade=CascadeType.PERSIST)
	@JoinColumn(name="department_id")
	private Department department5;
	
	public Department getDepartment5() {
		return department5;
	}
	public void setDepartment5(Department department5) {
		this.department5 = department5;
	}
	
	@OneToOne
	@JoinColumn(name="dict_id")
	private Dict dict;
	
	public Dict getDict() {
		return dict;
	}
	public void setDict(Dict dict) {
		this.dict = dict;
	}
	
	public String getReason() {
		return reason;
	}
	public void setReason(String reason) {
		this.reason = reason;
	}
	
	public Timestamp getStartTime() {
		return startTime;
	}
	public void setStartTime(Timestamp startTime) {
		this.startTime = startTime;
	}
	public Timestamp getEndTime() {
		return endTime;
	}
	public void setEndTime(Timestamp endTime) {
		this.endTime = endTime;
	}
	public Date getCheckTime() {
		return checkTime;
	}
	public void setCheckTime(Date checkTime) {
		this.checkTime = checkTime;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	
	

}
